package textprocessing.nlpanalysis.entity_linking;

import edu.stanford.nlp.pipeline.Annotation;
import semantic_compute.entity_linking.schema.EntityLinkingResult;
import semantic_compute.entity_linking.yago_linker.YagoTextsEntityLinker;

/**
 * Created by common on 2017/4/2.
 */
public class TextEntityLinker {


    private YagoTextsEntityLinker yagoTextsEntityLinker;

    public TextEntityLinker(){
        this.yagoTextsEntityLinker = new YagoTextsEntityLinker();
    }


    public EntityLinkingResult getTextEntityLinkingResult(String text,Annotation document){
        // 1) 获取结果
        EntityLinkingResult entityLinkingResult = this.yagoTextsEntityLinker.getYagoEntityLinkingResult( text );

        // 2）对齐下标 + 指代消解
        entityLinkingResult.alignWithCoreNlp(document);

        return entityLinkingResult;
    }





    /********************************************************************************
     *
     * @param text
     * @return
     */
    public static String[] linkEntityFromKG(String text){

        String[] result = new String[0];

        return result;

    }


}
